﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Icst.Leaflike.Web.controls;
using Icst.Leaflike.Data;

namespace Icst.Leaflike.Web.gather
{
    public partial class _default : pagegather
    {
        protected IEnumerable<tree_gather> _gatherings;
        protected Paginator paginator;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && IsLogon)
            {
                int count = Gathering.Instance.CountGathers(uid);
                paginator.RecordCount = count;
                paginator.Visible = count>0;
                if(count>0)
                    _gatherings = Gathering.Instance.SearchGathers(uid,Request["page"] == null ? 1 : int.Parse(Request["page"]), Request["sort"] == null ? 0 : int.Parse(Request["sort"]),10);
            }
        }
    }
}
